package com.ant.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * @author 党怡承
 * @version 1.0
 * @date 2021-08-04 10:16
 * @description
 * @copyright 2021
 */
@Data
public class Result<T> implements Serializable {
  private boolean flag;

  private int code;

  private String msg;

  private T data;

  public  Result(boolean flag, int code, String msg, Object data) {
    this.flag = flag;
    this.code = code;
    this.msg = msg;
    this.data = (T) data;
  }

  public Result(boolean flag, int code, String msg) {
    this.flag = flag;
    this.code = code;
    this.msg = msg;
  }

  public Result() {
    this.flag = true;
    this.code = StatusCode.OK;
    this.msg = "操作成功";
  }
}
